package com.sokal.easycare.modules.sys.entity;

import com.sokal.easycare.modules.sys.entity.MainUser;
import org.hibernate.validator.constraints.Length;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sokal.easycare.common.persistence.DataEntity;

/**
 * 用户地址Entity
 * @author yangmin
 * @version 2017-04-11
 */
public class UserAddr extends DataEntity<UserAddr> {
	
	private static final long serialVersionUID = 1L;
	private MainUser user;		// 用户
	private String province;		// 省
	private String city;		// 地市
	private String prefecture;		// 区县
	private String phone;		// 电话
	private String address;		// 地址
	private String consignee;  //收货人
	private String isdefault;		// 默认
	
	public UserAddr() {
		super();
	}

	public UserAddr(String id){
		super(id);
	}

	@JsonIgnore
	public MainUser getUser() {
		return user;
	}

	public void setUser(MainUser user) {
		this.user = user;
	}
	
	@Length(min=0, max=20, message="省长度必须介于 0 和 20 之间")
	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}
	
	@Length(min=0, max=20, message="地市长度必须介于 0 和 20 之间")
	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}
	
	@Length(min=0, max=20, message="区县长度必须介于 0 和 20 之间")
	public String getPrefecture() {
		return prefecture;
	}

	public void setPrefecture(String prefecture) {
		this.prefecture = prefecture;
	}
	
	@Length(min=0, max=20, message="电话长度必须介于 0 和 20 之间")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	@Length(min=0, max=100, message="地址长度必须介于 0 和 100 之间")
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	
	public String getConsignee() {
		return consignee;
	}

	public void setConsignee(String consignee) {
		this.consignee = consignee;
	}

	@Length(min=0, max=1, message="默认长度必须介于 0 和 1 之间")
	public String getIsdefault() {
		return isdefault;
	}

	public void setIsdefault(String isdefault) {
		this.isdefault = isdefault;
	}
	
}